<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="com.google.appengine.api.blobstore.BlobInfoFactory" %>
<%@ page import="com.google.appengine.api.blobstore.BlobInfo" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<html>
<body>
    <form name="serve" action="" method="post" target="_blank"></form>
    <table>
        <tr><th>FileName</th><th>BlobKey</th></tr>
    <% Iterator<BlobInfo> blobs = new BlobInfoFactory().queryBlobInfos();
       
       while(blobs.hasNext()) {
        BlobInfo bi = blobs.next(); %>
        <tr><td><%=bi.getFilename()%></td><td><a href="javascript:submitServe('<%=bi.getBlobKey().getKeyString()%>');"><%=bi.getBlobKey().getKeyString()%></a></td></tr>
    <% } %>
    </table>
</body>
<script>
    function submitServe(blobkey) {
    	form = document.forms[0];
    	form.action = "/blobup/blobServe?bk=" + blobkey;
    	form.submit()
    }
</script>
</html>